/*    This file is part of ilk.
 *
 *    Ilk is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU Lesser General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    Ilk is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public License
 *    along with ilk.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef ILK_FRONT_H
#define ILK_FRONT_H

/*
Include:
#include <dirent.h>
#include <rid.h>
#include <stdint.h>

#include <unfy/unfy.h>
#include <rls/rls.h>
#include <rls/rlsp.h>

#include <nit/list.h>
#include <nit/set.h>
#include <nit/map.h>
#include <nit/err.h>
#include <nit/file.h>
#include <nit/buf.h>
#include <nit/gap.h>

#include <ilk/utilize.h>

#include <ilk/front.h>
*/

#ifndef STYLE_9
#include <ilk/utilize.h>
#endif

void
ilk_lib_init(Ilk_lib *lib, uint16_t act_max, Rls_act *act_table);

void
ilk_lib_dispose(Ilk_lib *lib);

int
ilk_sys_init(Ilk_sys *sys, Ilk_lib *lib, const char *dir_name);

void
ilk_sys_dispose(Ilk_sys *sys);

Ilk_sys *
ilk_sys(Ilk_lib *lib, const char *dir_name);

void
ilk_sys_rec(Ilk_sys *sys);

int
ilk_sys_save(Ilk_sys *sys);

const char *
ilk_rule_valid(const Unfy_term *head, const Unfy_list *body);

Ilk_grp *
ilk_rule_add(Ilk_sys *sys, const Rid id, Unfy_term *head, Unfy_list *body,
	     uint64_t srch_cnt);

Ilk_grp *
ilk_act_add(Ilk_sys *sys, const Rid id, Unfy_term *head, uint16_t act_id);

Unfy_stat
ilk_srch_n_save(Ilk_sys *sys, Rls_srch **srch_ref, Unfy_term *term,
		int *limit, Rls_info *info);

#endif
